/**
 * 
 */
package it.unical.canonaco.rende.igpe.game.cbv.guilayer.sprites;

import java.awt.Image;
import java.util.HashMap;

/**
 * @author Massimo Canonaco
 *
 */
public class LinkedSpriteSheet implements SpriteSheetInterface {

	/** */
	private HashMap<String, Image> textures;
	
	/** */
	private String lastNewFrame;
	
	public LinkedSpriteSheet()
	{
		textures = new HashMap<>();
	}
	/* (non-Javadoc)
	 * @see it.unical.canonaco.rende.igpe.game.cbv.guilayer.sprites.SpriteSheetInterface#getFrame(java.lang.String)
	 */
	@Override
	public Image getFrame(String frameID) 
	{
		return textures.get(frameID);
	}

	/* (non-Javadoc)
	 * @see it.unical.canonaco.rende.igpe.game.cbv.guilayer.sprites.SpriteSheetInterface#getFrame(int, int, int, int)
	 */
	@Override
	public Image getFrame(int topx, int topy, int width, int height) 
	{
		return null;
	}

	/* (non-Javadoc)
	 * @see it.unical.canonaco.rende.igpe.game.cbv.guilayer.sprites.SpriteSheetInterface#getNext(java.lang.String)
	 */
	@Override
	public Sprite getNext(String frameID) 
	{
		return null;
	}

	/* (non-Javadoc)
	 * @see it.unical.canonaco.rende.igpe.game.cbv.guilayer.sprites.SpriteSheetInterface#setImage(java.awt.Image)
	 */
	@Override
	public void setImage(Image image) 
	{
		textures.put(lastNewFrame, image);
	}

	/* (non-Javadoc)
	 * @see it.unical.canonaco.rende.igpe.game.cbv.guilayer.sprites.SpriteSheetInterface#addFrame(it.unical.canonaco.rende.igpe.game.cbv.guilayer.sprites.Sprite)
	 */
	@Override
	public void addFrame(Sprite sprite) 
	{
		lastNewFrame = sprite.getFrameName();
	}
	
	@Override
	public Sprite getSprite(String spriteID) 
	{
		return null;
	}

}
